package com.recognition.swing;

import java.awt.Color;
import java.awt.Graphics;
import java.awt.image.BufferedImage;
import javax.swing.JPanel;

public class JImagePanel extends JPanel
{
	private BufferedImage _img;

	public void setImage(BufferedImage img)
	{
		_img = img;
		
		paintComponent(getGraphics());
	}	

	public void paintComponent(Graphics g)
	{		
		g.setColor(new Color(0, 0, 0));
		g.drawRect(0, 0, getWidth() - 1, getHeight() - 1);
		
		g.drawImage(_img, 1, 1, getWidth()-2, getHeight()-2, null);				
	}

	public void drawRedBox(int firstX, int firstY) {
		//Graphics g = getGraphics();
		//g.setColor(new Color(255, 0, 0));
		//g.drawRect(firstX, firstY, 50, 50);
	}
}